home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / mac / prime_CD / pb / basecast.cst / 00004_Script_demo case < prev    next >
Text File  |  1997-07-24  |  10KB  |  370 lines

  1. global demo,current_pm,dopm, prof_rolls, menumouse,sub_open,winhelp
  2.  
  3. on see_sprite plist, bool
  4.   repeat with e in plist
  5.     set the visible of sprite e to bool
  6.   end repeat
  7.   updatestage
  8. end
  9.  
  10. on nn memname
  11.   put the membernum of member memname
  12. end
  13.  
  14. on menumouse_check
  15.   if menumouse then
  16.     if the timer < 60 then
  17.       set menumouse = 0
  18.       abort
  19.     end if
  20.   end if
  21. end
  22.  
  23. on set_cursors clist
  24.   global oldclist
  25.   
  26.   if not voidp(oldclist) then
  27.     repeat with x in oldclist
  28.       
  29.       set the cursor of sprite x to 0
  30.     end repeat
  31.   end if
  32.   
  33.   repeat with x in clist
  34.     set the cursor of sprite x = [the membernum of member "hand",the membernum of member "hand mask"]
  35.   end repeat
  36.   
  37.   set oldclist = clist
  38.   cursor 0
  39. end
  40.  
  41. on pm_prep pm
  42.   cursor 4
  43.   set current_pm = pm
  44.   set test = demo_check(current_pm)
  45.   if not test then
  46.     set dopm = TRUE
  47.     cursor 0
  48.   end if
  49. end
  50.  
  51.  
  52. on idle
  53.   if not sub_open then
  54.     pmidle
  55.     eraidle
  56.     if winhelp then 
  57.       global helpapp
  58.       openxlib "dllglue.dll"
  59.       set findObj = DLLGLUE( mNew, "USER.EXE", "FindWindow", "W", "SS" )
  60.       set toTop = DLLGLUE( mNew, "USER.EXE", "BringWindowToTop","I","W")
  61.       set sw to dllglue(mnew, "USER.EXE", "ShowWindow", "V", "WI")
  62.       global win31
  63.       if win31 then 
  64.         set theWindow to findObj( mCall, 0, "pmhelp31" )
  65.       else
  66.         set theWindow to findObj( mCall, 0, "pmhelp" )
  67.       end if
  68.       
  69.       if theWindow > 0 then 
  70.         toTop( mCall, theWindow )
  71.         sw(mcall, theWindow, 9)
  72.       else
  73.         open helpapp with "winhelp"
  74.       end if
  75.       
  76.       toTop(mdispose)
  77.       findObj(mdispose)
  78.       sw(mdispose)
  79.       set winhelp to false
  80.     end if
  81.   end if
  82. end
  83.  
  84. on convert32 theList
  85.   set red to (getAt(theList, 1) * 255 * 65536) / 100.00
  86.   set green to (getAt(theList, 2) * 255 * 256) / 100.00
  87.   set blue to (getAt(theList, 3) * 255 * 1) / 100.00
  88.   return red + green + blue
  89. end
  90.  
  91. on convert16 theList
  92.   set normedList = theList  / 8
  93.   set red to integer(getAt(normedList, 1)) * 1024
  94.   set green to integer(getAt(normedList, 2)) * 32 
  95.   set blue to integer(getAt(normedList, 1))
  96.   return red + green + blue
  97. end
  98.  
  99. on eraidle
  100.   global doera
  101.   if doera <> 0 then
  102.     set tmp = doera
  103.     set doera = 0
  104.     --    put tmp
  105.     goera(tmp)
  106.   end if
  107.   
  108. end
  109.  
  110. on fullPathFor destFileName -- figures out correct pathname for (director) files containing 'prof', 'arch' or 'era_' for PM cd structure (kf 11/20/96)
  111.   
  112.   set pathHead = the moviepath
  113.   if the machinetype = 256 then set pd = "\"
  114.   else set pd = ":"
  115.   
  116.   case true of
  117.     ((the movie contains "arch") or (the movie contains "prof")) and (destfilename contains "era_"):
  118.       if destfilename <> "era_top.dir" then 
  119.         set tail = "eras" & pd & char 5 to 6 of destFileName & pd & destfilename
  120.       else set tail = "eras" & pd & destfilename
  121.       set fullPathName = pathhead & tail
  122.       
  123.     ((the movie contains "era_") and ((destFileName contains "arch") or (destFileName contains "prof"))):
  124.       delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
  125.       set fullPathName = pathhead & destFileName
  126.       
  127.       --    ((the movie contains "era_") and 
  128.     (destFileName contains "era_"):
  129.       delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
  130.       
  131.       if destfilename contains "era_top.dir" then
  132.         set tail = "eras" & pd  & destfilename
  133.       else
  134.         set tail = "eras" & pd & char 5 to 6 of destFileName & pd & destfilename
  135.       end if
  136.       
  137.       set fullPathName = pathhead & tail
  138.       
  139.     otherwise:
  140.       delete char offset("pb", the moviepath)+3 to length(the moviepath) of pathhead
  141.       set fullPathName = pathhead & destFileName
  142.   end case
  143.   
  144.   return fullPathName
  145. end
  146.  
  147.  
  148. on pmidle  
  149.   if dopm = TRUE then
  150.     if (the moviename <> "profile.dir") then 
  151.       if the colordepth > 8 then puppettransition 51,02,08
  152.       if the moviename contains "era_" then
  153.         go to marker("fadeout") + 1
  154.       else
  155.         go to "fadeout"
  156.       end if
  157.       
  158.       set the castnum of sprite 1 to cast "load_pro"
  159.       updatestage
  160.       --      sound playfile 1, "00prf.aif"
  161.       go to movie fullpathfor("profile.dir") -- prs kf 11/20/96
  162.       abort
  163.     end if
  164.     
  165.     global current_pm
  166.     if voidp(current_pm) then dopm(0)
  167.     else dopm(current_pm)
  168.   end if
  169. end
  170.  
  171. on era_prep pm
  172.   global doera
  173.   if pm <> 0 then
  174.     set doera = pm
  175.   end if
  176. end
  177.  
  178. on goera the_pm
  179.   global gnextmoviefilename
  180.   unload
  181.   sound stop 1
  182.   if the colordepth > 8 then puppettransition 51,02,08
  183.   go to "fadeout"
  184.   case demo of
  185.     0 :
  186.       case the_pm of
  187.         1,2,3,4,5,6 :
  188.           set gnextmoviefilename =  "era_vi.dir"
  189.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  190.         7 :
  191.           set gnextmoviefilename =    "era_la.dir"
  192.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  193.         8,9,11 :
  194.           set gnextmoviefilename = "era_gp.dir"
  195.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  196.         10, 12: 
  197.           set gnextmoviefilename =    "era_ky.dir"
  198.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  199.         13,14 : 
  200.           set gnextmoviefilename =   "era_td.dir"
  201.           
  202.           if the moviename <> gnextmoviefilename then
  203.             --            sound playfile 1, "diana.aif"
  204.             go to movie gnextmoviefilename
  205.           end if
  206.         15, 16, 17 : 
  207.           set gnextmoviefilename =  "era_ty.dir"
  208.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  209.         18,19, 20 :
  210.           set gnextmoviefilename = "era_ad.dir"
  211.           if the movie <> gnextmoviefilename then go to movie gnextmoviefilename
  212.       end case
  213.     1 :
  214.       if the movie = "archive.dir" then 
  215.         archive_check
  216.         set gnextmoviefilename = "era_top.dir"
  217.       else
  218.         case the_pm of
  219.             
  220.           13,14 : set gnextmoviefilename =   "era_td.dir"
  221.             --          10 : set gnextmoviefilename = "era_ky.dir"
  222.           otherwise
  223.             set gnextmoviefilename = "era_top.dir"
  224.         end case
  225.       end if
  226.       
  227.       if the moviename <> gnextmoviefilename then
  228.         if gnextmoviefilename <> "era_td.dir" then 
  229.           --          sound playfile 1, "old_girl.aif"
  230.         else
  231.           --          sound playfile 1, "diana.aif"
  232.         end if
  233.         go to movie gnextmoviefilename
  234.       end if
  235.   end case
  236.   
  237.   abort 
  238. end
  239.  
  240. on purgemem
  241.   unload
  242. end
  243.  
  244.  
  245.  
  246. on soundcheck pm
  247.   global done_sound
  248.   if not done_sound then
  249.     sound stop 1
  250.     set tfl to the framelabel
  251.     if length(string(tfl)) > 0 then
  252.       if not(tfl contains "w") then
  253.         case (pm) of
  254.           "1": sound playFile 1, "01prf.aif"
  255.           "7": sound playFile 1, "07prf.aif"
  256.           "10": sound playFile 1, "10prf.aif"
  257.           "13": sound playFile 1, "13prf.aif"
  258.           "14": sound playFile 1, "14prf.aif"
  259.           "15": sound playFile 1, "15prf.aif"
  260.           "18": sound playFile 1, "18prf.aif"
  261.         end case
  262.       end if
  263.     end if
  264.   end if
  265.   set done_sound = 0
  266. end
  267.  
  268. on erademopop
  269.   opendemopop(#eras)
  270. end
  271.  
  272. on democheck_era gDestMovie
  273.   global demo
  274.   if demo then
  275.     case gDestMovie of
  276.       "era_ty.dir" : 
  277.         opendemopop #eras
  278.         return true
  279.       "era_gp.dir" : 
  280.         opendemopop #eras
  281.         return true
  282.       otherwise
  283.         return false
  284.     end case
  285.     abort
  286.   end if
  287. end
  288.  
  289.  
  290. on demo_check the_pm
  291.   
  292.   if demo then
  293.     case the_pm of
  294.       "0","1", "2","4","5","6","9","10","11","13","14","15","17" : set doit to true
  295.     end case
  296.     if voidp(doit) then 
  297.       cursor 4
  298.       set dopm = 0
  299.       opendemopop(#profile)
  300.       return true
  301.       abort
  302.     end if  
  303.   end if
  304. end
  305.  
  306. on opendemopop state
  307.   cursor 4
  308.   set  the visible of window "demopop.dir" = false
  309.   set the windowType of window  "demopop.dir" = 2
  310.   set the modal of window "demopop.dir" = true
  311.   case state of
  312.     #profile : tell window "demopop.dir" to go to frame 1
  313.     #eras : tell window "demopop.dir" to go to frame 2
  314.     #archive : tell window "demopop.dir" to go to frame 3
  315.     #preview : tell window "demopop.dir" to go to frame 4
  316.     #previewtop : tell window "demopop.dir" to go to frame 5
  317.     #quit : tell window "demopop.dir" to go to frame 6
  318.   end case
  319.   set stop = the rect of the stage
  320.   set drect = the rect of window "demopop.dir"
  321.   set the rect of window "demopop.dir" = rect(the left of stop + 24,the top of stop + 40,the left of stop + 24 + (the right of drect - the left of drect),the top of stop + 40 + (the bottom of drect - the top of drect))
  322.   set the visible of window "demopop.dir" = true
  323.   
  324.   tell window "demopop.dir" to starttimer
  325.   tell the stage to pause
  326.   cursor 4
  327.   cursor -1
  328. end
  329.  
  330. on openeventq
  331.   --  global eq
  332.   --  openXlib "EventQ"
  333.   --  set eq = EventQ(mNew)
  334. end
  335.  
  336. on closeeventq
  337.   --  global eq
  338.   --  if objectP(eq) then 
  339.   --    eq(mDispose)
  340.   --    closeXlib "EventQ"
  341.   --  end if
  342. end
  343.  
  344. on startbuffering
  345.   --  global eq
  346.   --  eq(mBufferEvents)
  347.   
  348.   -- repeat
  349.   --
  350.   -- Do some critical Lingo here, without interference from the user.
  351.   --
  352.   -- Have they hit the mouse button?
  353.   --
  354.   -- set mouseString = eq(mGetNextEvent, "mouseDown", 1)
  355.   --
  356.   -- mouseString will be: "mouseDown 100, 244" if left button down at
  357.   -- these coordinates
  358.   --
  359.   -- until someCondition
  360.   
  361.   --
  362.   -- Stop the buffering
  363.   --
  364. end
  365.  
  366. on flushevents
  367.   if the machinetype = 256 then 
  368.     if objectp(eq) then put eq(mFlushEvents) into yikes
  369.   end if
  370. end